#include "stdafx.h"
#include "Utils\ImageLoader.h"


CImageLoader::CImageLoader()
{}



CImageLoader::~CImageLoader()
{}



CImageLoader& CImageLoader::GetInstance()
{
	static CImageLoader mInstance;
	return mInstance;
}



CImage* CImageLoader::GetSpeakerImg()
{
	return &mSpeakerImg;
}


CImage* CImageLoader::GetPhoneImg()
{
	return &mPhoneImg;
}


CImage* CImageLoader::GetWarningImg()
{
	return &mWarningImg;
}



CImage* CImageLoader::GetFlashImg()
{
	return &mFlashImg;
}



void CImageLoader::LoadAllImage(CLayout& layout)
{
	mSpeakerImg.Load(layout.GetHolderWndLayout().image_talking.path);
	mPhoneImg.Load(layout.GetHolderWndLayout().image_miss.path);
	mWarningImg.Load(layout.GetHolderWndLayout().image_request.path);
	mFlashImg.Load(layout.GetMainWndLayout().uFlash.path);
	//HANDLE handle  = ::LoadImage(NULL, _T("..\\Resource\\icon\\speaker.bmp"), IMAGE_BITMAP, 48, 48, LR_LOADFROMFILE);
	//mSpeakerIcon  = (HBITMAP)MAKEINTRESOURCE(handle);


	//mSpeakerImg.Load(_T("..\\Resource\\icon\\speaker.bmp"));

	//handle = ::LoadImage(NULL, _T("..\\Resource\\icon\\phone.bmp"), IMAGE_BITMAP, 30, 30, LR_LOADFROMFILE);
	//mPhoneIcon = (HBITMAP)MAKEINTRESOURCE(handle);

	//handle = ::LoadImage(NULL, _T("..\\Resource\\icon\\warning.bmp"), IMAGE_BITMAP, 30, 30, LR_LOADFROMFILE);
	//mWarningIcon = (HBITMAP)MAKEINTRESOURCE(handle);

	//CImage img;
	//HANDLE handle;

	//img.Load(_T("..\\Resource\\icon\\speaker.png"));
	//Filte(img);


	//mSpeakerIcon  = img.Detach();

	//img.Load(_T("..\\Resource\\icon\\phone.png"));
	//Filte(img);

	//mPhoneIcon  = img.Detach();

	//img.Load(_T("..\\Resource\\icon\\warning.png"));
	//Filte(img);

	//mWarningIcon  = img.Detach();
}
